/*

Liberty Barnes	
Proposal title: Distributive Justice in American Healthcare

HYPOTHESES

Stated-Hyp1: Are Americans discriminatory in their beliefs regarding how responsible 
patients are for their health problems and how deserving they are of healthcare? Examines how social identifiers of age, sex, race/ethnicity, immigrant status, socioeconomic status, and medical diagnosis impact perceptions of personal responsibility (PR) and deservedness (JD)

	Test-Hyp1: There will be a difference in perception of personal responsbility by patient's age (continuous age)
	
	Test-Hyp2: There will be a difference in perception of personal responsbility by patient's sex.
	
	Test-Hyp3: There will be a difference in perception of personal responsbility by patient's race (black vs. white).

	Test-Hyp4: There will be a difference in perception of personal responsbility by patient's ethnicity (Hispanic vs. white).	
	
	Test-Hyp5: There will be a difference in perception of personal responsbility by patient's immigrant status.
	
	Test-Hyp6: There will be a difference in perception of personal responsbility by patient's SES.
	
	Test-Hyp7: There will be a difference in perception of personal responsbility by patient's medical diagnosis (leukemia vs. HIV).

	Test-Hyp8: There will be a difference in perception of personal responsbility by patient's medical diagnosis (leukemia vs. GAD).	

	Test-Hyp9: There will be a difference in perception of personal responsbility by patient's medical diagnosis (GAD vs. HIV).
	
	
	Test-Hyp10: There will be a difference in attitudinal indicator of perception of deservedness by patient's age (continuous age)
	
	Test-Hyp11: There will be a difference in attitudinal indicator of perception of deservedness by patient's sex.
	
	Test-Hyp12: There will be a difference in attitudinal indicator of perception of deservedness by patient's race (black vs. white).

	Test-Hyp13: There will be a difference in attitudinal indicator of perception of deservedness by patient's ethnicity (Hispanic vs. white).	
	
	Test-Hyp14: There will be a difference in attitudinal indicator of perception of deservedness by patient's immigrant status.
	
	Test-Hyp15: There will be a difference in attitudinal indicator of perception of deservedness by patient's SES.
	
	Test-Hyp16: There will be a difference in attitudinal indicator of perception of deservedness by patient's medical diagnosis (leukemia vs. HIV).

	Test-Hyp17: There will be a difference in attitudinal indicator of perception of deservedness by patient's medical diagnosis (leukemia vs. GAD).	

	Test-Hyp18: There will be a difference in attitudinal indicator of perception of deservedness by patient's medical diagnosis (GAD vs. HIV).
		
	
	
	
	
	Test-Hyp19: There will be a difference in behavioral indicator of perception of deservedness by patient's age (continuous age)
	
	Test-Hyp20: There will be a difference in behavioral indicator of perception of deservedness by patient's sex.
	
	Test-Hyp21: There will be a difference in behavioral indicator of perception of deservedness by patient's race (black vs. white).

	Test-Hyp22: There will be a difference in behavioral indicator of perception of deservedness by patient's ethnicity (Hispanic vs. white).	
	
	Test-Hyp23: There will be a difference in behavioral indicator of perception of deservedness by patient's immigrant status.
	
	Test-Hyp24: There will be a difference in behavioral indicator of perception of deservedness by patient's SES.
	
	Test-Hyp25: There will be a difference in behavioral indicator of perception of deservedness by patient's medical diagnosis (leukemia vs. HIV).

	Test-Hyp26: There will be a difference in behavioral indicator of perception of deservedness by patient's medical diagnosis (leukemia vs. GAD).	

	Test-Hyp27: There will be a difference in behavioral indicator of perception of deservedness by patient's medical diagnosis (GAD vs. HIV).	
	




Stated-Hyp2: To what extent do perceptions of PR (personal responsibility) mediate the 
relationship between patient attributes and JD (just deservedness)?

	
	Test-Hyp28: Perceptions of PR will mediate the  attitudinal indicator of perception of deservedness by patient's age (continuous).
	
	Test-Hyp29: Perceptions of PR will mediate the  attitudinal indicator of  perception of deservedness by patient's sex.
	
	Test-Hyp30: Perceptions of PR will mediate the  attitudinal indicator of  perception of deservedness by patient's race (black vs. white).

	Test-Hyp31: Perceptions of PR will mediate the  attitudinal indicator of  perception of deservedness by patient's ethnicity (Hispanic vs. white).
	
	Test-Hyp32: Perceptions of PR will mediate the  attitudinal indicator of  perception of deservedness by patient's immigrant status.
	
	Test-Hyp33: Perceptions of PR will mediate the  attitudinal indicator of  perception of deservedness by patient's SES.
	
	Test-Hyp34: Perceptions of PR will mediate the attitudinal indicator of  perception of deservedness by patient's medical diagnosis (leukemia vs. HIV).	

	Test-Hyp35: Perceptions of PR will mediate the attitudinal indicator of  perception of deservedness by patient's medical diagnosis (leukemia vs. GAD).	

	Test-Hyp36: Perceptions of PR will mediate the attitudinal indicator of  perception of deservedness by patient's medical diagnosis (GAD vs. HIV).	
	
	
	
	
	Test-Hyp37: Perceptions of PR will mediate the behavioral indicator of perception of deservedness by patient's age (continuous).
	
	Test-Hyp38: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's sex.
	
	Test-Hyp39: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's race (black vs. white).

	Test-Hyp40: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's ethnicity (Hispanic vs. white).
	
	Test-Hyp41: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's immigrant status.
	
	Test-Hyp42: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's SES.
	
	Test-Hyp43: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's medical diagnosis (leukemia vs. HIV).	

	Test-Hyp44: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's medical diagnosis (leukemia vs. GAD).	

	Test-Hyp45: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's medical diagnosis (GAD vs. HIV).	
	
	
*/

clear all
use "BarnesS26.dta", clear

********************************************************************************

* CONSTRUCT INDICATORS OF EXPERIMENTAL MANIPULATIONS

* Diagnosis
	tab P_DISORDER
	clonevar diagnosis=P_DISORDER
	recode P_DISORDER (1=1) (2=0) (3=.), gen(leu_hiv)
	recode P_DISORDER (1=1) (2=.) (3=0), gen(leu_gad)
	recode P_DISORDER (1=.) (2=0) (3=1), gen(gad_hiv)
	
* patient age
	tab DOV_AGE
	gen patient_age=DOV_AGE
	
* patient gender
	tab DOV_GEND
	recode DOV_GEND (1=0) (2=1), gen(patient_female)
	tab patient_female
	
* patient race
	tab P_RACE
	recode P_RACE (1=1) (3=0) (*=.), gen(patient_black)
	recode P_RACE (2=1) (3=0) (*=.), gen(patient_hispanic)	

* patient immigrant status
	tab P_NATIVE
	gen patient_immigrant=1 if P_NATIVE==2
	replace patient_immigrant=0 if P_NATIVE==1
	tab patient_immigrant

* patient SES
	tab P_CLASS
	gen patient_upperclass=1 if P_CLASS==1
	replace patient_upperclass=0 if P_CLASS==2
	tab patient_upperclass

* CONSTRUCT OUTCOME MEASURES

* personal responsibility for disorder 
	/* note: personal responsibility is measured using two questions, factors outside of control and factors in control (percieved percent of)
	There are no details in the proposal about how the researcher plans to construct a PR measure. 
	I am constructing PR as % of factors in control minus % of factors outside control. The higher this ratio, the more R thinks that the individual is responsible. 
	
	*/
	
	* % of factors outside control
	gen personalresp_out=Q10A
	replace personalresp_out=. if Q10A>100
	tab personalresp_out, mis

	* % of factors within control
	gen personalresp_in=Q10B
	replace personalresp_in=. if Q10B>100
	tab personalresp_in, mis
	
	gen personalresp = personalresp_in - personalresp_out if personalresp_in!=. & personalresp_out!=.
	tab personalresp

* just deservedness (what % of bills should insurance cover)
	*(attitudinal measure of JD)
	gen deservedness_attitude= Q11
	replace deservedness_attitude=. if Q11>100
	tab deservedness_attitude, mis

* willingness to sign petition asking insurance provider to cover cost 
	* (behavioral measure of JD)
	gen deservedness_behavior=1 if Q12==1
	replace deservedness_behavior=0 if Q12==2
	tab deservedness_behavior, mis

	

********************************************************************************

* ANALYSIS
	
*Test-Hyp1: There will be a difference in perception of personal responsbility by patient's age (continuous age)
	reg personalresp patient_age
	// do not reject. 0.000
	tess patient_age, init(BarnesS26) bonf(3)
		
	
*Test-Hyp2: There will be a difference in perception of personal responsbility by patient's sex.
	reg personalresp i.patient_female
	// reject. 0.804	
	tess 1.patient_female, bonf (3)	
	
*Test-Hyp3: There will be a difference in perception of personal responsbility by patient's race (black vs. white).
	reg personalresp i.patient_black
	// reject. 0.087
	tess 1.patient_black, bonf (3)	
	
*Test-Hyp4: There will be a difference in perception of personal responsbility by patient's ethnicity (Hispanic vs. white).	
	reg personalresp i.patient_hispanic
	// reject. 0.474	
	tess 1.patient_hispanic, bonf (3)	
	
	
*Test-Hyp5: There will be a difference in perception of personal responsbility by patient's immigrant status.
	reg personalresp i.patient_immigrant
	// reject. 0.765		
	tess 1.patient_immigrant, bonf (3)	
		
*Test-Hyp6: There will be a difference in perception of personal responsbility by patient's SES.
	reg personalresp i.patient_upperclass
	// reject. 0.962	
	tess 1.patient_upperclass, bonf (3)	
	
*Test-Hyp7: There will be a difference in perception of personal responsbility by patient's medical diagnosis (leukemia vs. HIV).
	reg personalresp i.leu_hiv
	// do not reject. 0.000
	tess 1.leu_hiv, bonf (3)	
	
	
*Test-Hyp8: There will be a difference in perception of personal responsbility by patient's medical diagnosis (leukemia vs. GAD).	
	reg personalresp i.leu_gad
	// do not reject. 0.000
	tess 1.leu_gad, bonf (3)
	
*Test-Hyp9: There will be a difference in perception of personal responsbility by patient's medical diagnosis (GAD vs. HIV).
	reg personalresp i.gad_hiv
	// reject. 0.053
	* bonferonni correction: test threshold is 0.05/3=0.0167
	tess 1.gad_hiv, bonf (3)	
	
*Test-Hyp10: There will be a difference in attitudinal indicator of perception of deservedness by patient's age (continuous age)
	reg deservedness_attitude patient_age
	// reject. 0.08
	tess patient_age, bonf(3)
	
*Test-Hyp11: There will be a difference in attitudinal indicator of perception of deservedness by patient's sex.
	reg deservedness_attitude i.patient_female
	// reject. 0.603
	tess 1.patient_female, bonf (3)	
	
*Test-Hyp12: There will be a difference in attitudinal indicator of perception of deservedness by patient's race (black vs. white).
	reg deservedness_attitude i.patient_black
	// reject. 0.623
	tess 1.patient_black, bonf (3)	
	

*Test-Hyp13: There will be a difference in attitudinal indicator of perception of deservedness by patient's ethnicity (Hispanic vs. white).	
	reg deservedness_attitude i.patient_hispanic
	// reject. 0.193
	tess 1.patient_hispanic, bonf (3)	
	
*Test-Hyp14: There will be a difference in attitudinal indicator of perception of deservedness by patient's immigrant status.
	reg deservedness_attitude i.patient_immigrant
	// reject. 0.920
	tess 1.patient_immigrant, bonf (3)	
	
*Test-Hyp15: There will be a difference in attitudinal indicator of perception of deservedness by patient's SES.
	reg deservedness_attitude i.patient_upperclass
	// reject. 0.052
	* bonferonni correction needed. threshold is 0.05/3
	tess 1.patient_upperclass, bonf (3)	
	
*Test-Hyp16: There will be a difference in attitudinal indicator of perception of deservedness by patient's medical diagnosis (leukemia vs. HIV).
	reg deservedness_attitude i.leu_hiv
	// reject. 0.053
	* bonferonni correction needed. threshold is 0.05/3
	tess 1.leu_hiv, bonf (3)	
	
*Test-Hyp17: There will be a difference in attitudinal indicator of perception of deservedness by patient's medical diagnosis (leukemia vs. GAD).	
	reg deservedness_attitude i.leu_gad
	// reject. 0.174
	* bonferonni correction needed. threshold is 0.05/3
	tess 1.leu_gad, bonf (3)	
	
*Test-Hyp18: There will be a difference in attitudinal indicator of perception of deservedness by patient's medical diagnosis (GAD vs. HIV).
	reg deservedness_attitude i.gad_hiv
	// reject. 0.529
	* bonferonni correction needed. threshold is 0.05/3		
	tess 1.gad_hiv, bonf (3)		
	
	
	
*Test-Hyp19: There will be a difference in behavioral indicator of perception of deservedness by patient's age (continuous age)
	reg deservedness_behavior patient_age
	// reject. 0.677
	tess patient_age, bonf(3)
	
*Test-Hyp20: There will be a difference in behavioral indicator of perception of deservedness by patient's sex.
	reg deservedness_behavior i.patient_female
	// reject. 0.715
	tess 1.patient_female, bonf (3)	
	
*Test-Hyp21: There will be a difference in behavioral indicator of perception of deservedness by patient's race (black vs. white).
	reg deservedness_behavior i.patient_black
	// reject. 0.603
	tess 1.patient_black, bonf (3)	
	
*Test-Hyp22: There will be a difference in behavioral indicator of perception of deservedness by patient's ethnicity (Hispanic vs. white).	
	reg deservedness_behavior i.patient_hispanic
	// reject. 0.231
	tess 1.patient_hispanic, bonf (3)	
	
*Test-Hyp23: There will be a difference in behavioral indicator of perception of deservedness by patient's immigrant status.
	reg deservedness_behavior i.patient_immigrant
	// reject. 0.236
	tess 1.patient_immigrant, bonf (3)	
	
*Test-Hyp24: There will be a difference in behavioral indicator of perception of deservedness by patient's SES.
	reg deservedness_behavior i.patient_upperclass
	// reject. 0.100
	tess 1.patient_upperclass, bonf (3)	
	
*Test-Hyp25: There will be a difference in behavioral indicator of perception of deservedness by patient's medical diagnosis (leukemia vs. HIV).
	reg deservedness_behavior i.leu_hiv
	// do not reject. 0.004
	tess 1.leu_hiv, bonf (3)	
	
*Test-Hyp26: There will be a difference in behavioral indicator of perception of deservedness by patient's medical diagnosis (leukemia vs. GAD).	
	reg deservedness_behavior i.leu_gad
	// do not reject. 0.000
	tess 1.leu_gad, bonf (3)	
	
	
*Test-Hyp27: There will be a difference in behavioral indicator of perception of deservedness by patient's medical diagnosis (GAD vs. HIV).	
	reg deservedness_behavior i.gad_hiv
	// reject. 0.402
	tess 1.gad_hiv, bonf (3)


	
*Test-Hyp28: Perceptions of PR will mediate the  attitudinal indicator of perception of deservedness by patient's age (continuous).
	reg deservedness_attitude patient_age
	est sto m1

	reg deservedness_attitude personalresp patient_age 
	est sto m2
	
	suest m1 m2
	test [m1_mean]patient_age=[m2_mean]patient_age
	// do not reject. 0.000

	tess, mediation bonf (3)
	
*Test-Hyp29: Perceptions of PR will mediate the  attitudinal indicator of  perception of deservedness by patient's sex.
	
	reg deservedness_attitude patient_female
	est sto m1

	reg deservedness_attitude personalresp patient_female
	est sto m2
	
	suest m1 m2
	test [m1_mean]patient_female=[m2_mean]patient_female
	// reject. 0.2693	
	
	tess, mediation	bonf (3)
	
*Test-Hyp30: Perceptions of PR will mediate the  attitudinal indicator of  perception of deservedness by patient's race (black vs. white).

	reg deservedness_attitude patient_black
	est sto m1

	reg deservedness_attitude personalresp patient_black
	est sto m2
	
	suest m1 m2
	test [m1_mean]patient_black=[m2_mean]patient_black
	// reject. 0.217	

	tess, mediation	bonf (3)
	
*Test-Hyp31: Perceptions of PR will mediate the  attitudinal indicator of  perception of deservedness by patient's ethnicity (Hispanic vs. white).
	
	reg deservedness_attitude patient_hispanic
	est sto m1

	reg deservedness_attitude personalresp patient_hispanic
	est sto m2
	
	suest m1 m2
	test [m1_mean]patient_hispanic=[m2_mean]patient_hispanic
	// reject. 0.3105	
	
	tess, mediation	bonf (3)
	
*Test-Hyp32: Perceptions of PR will mediate the  attitudinal indicator of  perception of deservedness by patient's immigrant status.
	reg deservedness_attitude patient_immigrant
	est sto m1

	reg deservedness_attitude personalresp patient_immigrant
	est sto m2
	
	suest m1 m2
	test [m1_mean]patient_immigrant=[m2_mean]patient_immigrant
	// reject. 0.9142
	
	tess, mediation	bonf (3)
	
*Test-Hyp33: Perceptions of PR will mediate the  attitudinal indicator of  perception of deservedness by patient's SES.
	
	reg deservedness_attitude patient_upperclass
	est sto m1

	reg deservedness_attitude personalresp patient_upperclass
	est sto m2
	
	suest m1 m2
	test [m1_mean]patient_upperclass=[m2_mean]patient_upperclass
	// reject. 0.6972
	
	tess, mediation	bonf (3)
	
*Test-Hyp34: Perceptions of PR will mediate the attitudinal indicator of  perception of deservedness by patient's medical diagnosis (leukemia vs. HIV).	

	reg deservedness_attitude leu_hiv
	est sto m1

	reg deservedness_attitude personalresp leu_hiv
	est sto m2
	
	suest m1 m2
	test [m1_mean]leu_hiv=[m2_mean]leu_hiv
	// do not reject. 0.000

	tess, mediation	bonf (3)
	
*Test-Hyp35: Perceptions of PR will mediate the attitudinal indicator of  perception of deservedness by patient's medical diagnosis (leukemia vs. GAD).	

	reg deservedness_attitude leu_gad
	est sto m1

	reg deservedness_attitude personalresp leu_gad
	est sto m2
	
	suest m1 m2
	test [m1_mean]leu_gad=[m2_mean]leu_gad
	// do not reject. 0.000

	tess, mediation bonf (3)
	
	
*Test-Hyp36: Perceptions of PR will mediate the attitudinal indicator of  perception of deservedness by patient's medical diagnosis (GAD vs. HIV).	
	
	reg deservedness_attitude gad_hiv
	est sto m1

	reg deservedness_attitude personalresp gad_hiv
	est sto m2
	
	suest m1 m2
	test [m1_mean]gad_hiv=[m2_mean]gad_hiv
	// reject. 0.2188

	tess, mediation	bonf (3)
	
*Test-Hyp37: Perceptions of PR will mediate the behavioral indicator of perception of deservedness by patient's age (continuous).
	reg deservedness_behavior patient_age
	est sto m1

	reg deservedness_behavior personalresp patient_age 
	est sto m2
	
	suest m1 m2
	test [m1_mean]patient_age=[m2_mean]patient_age
	// do not reject. 0.000	
	
	tess, mediation	bonf (3)
	
*Test-Hyp38: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's sex.
	reg deservedness_behavior patient_female
	est sto m1

	reg deservedness_behavior personalresp patient_female
	est sto m2
	
	suest m1 m2
	test [m1_mean]patient_female=[m2_mean]patient_female
	// reject. 0.3808		
	
	tess, mediation bonf (3)
	
*Test-Hyp39: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's race (black vs. white).

	reg deservedness_behavior patient_black
	est sto m1

	reg deservedness_behavior personalresp patient_black
	est sto m2
	
	suest m1 m2
	test [m1_mean]patient_black=[m2_mean]patient_black
	// reject. 0.9124	

	tess, mediation	bonf (3)
	
*Test-Hyp40: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's ethnicity (Hispanic vs. white).
	
	reg deservedness_behavior patient_hispanic
	est sto m1

	reg deservedness_behavior personalresp patient_hispanic
	est sto m2
	
	suest m1 m2
	test [m1_mean]patient_hispanic=[m2_mean]patient_hispanic
	// reject. 0.0295
	* bonferonni correction: test threshold is 0.05/3=0.0167
	
	tess, mediation	bonf (3)
	
*Test-Hyp41: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's immigrant status.
	
	reg deservedness_behavior patient_immigrant
	est sto m1

	reg deservedness_behavior personalresp patient_immigrant
	est sto m2
	
	suest m1 m2
	test [m1_mean]patient_immigrant=[m2_mean]patient_immigrant
	// reject. 0.6049

	tess, mediation bonf (3)
	
	
*Test-Hyp42: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's SES.
	
	reg deservedness_behavior patient_upperclass
	est sto m1

	reg deservedness_behavior personalresp patient_upperclass
	est sto m2
	
	suest m1 m2
	test [m1_mean]patient_upperclass=[m2_mean]patient_upperclass
	// reject. 0.6473
	
	tess, mediation	bonf (3)
	
*Test-Hyp43: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's medical diagnosis (leukemia vs. HIV).	

	reg deservedness_behavior leu_hiv
	est sto m1

	reg deservedness_behavior personalresp leu_hiv
	est sto m2
	
	suest m1 m2
	test [m1_mean]leu_hiv=[m2_mean]leu_hiv
	// do not reject. 0.2111

	tess, mediation	bonf (3)

*Test-Hyp44: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's medical diagnosis (leukemia vs. GAD).	

	reg deservedness_behavior leu_gad
	est sto m1

	reg deservedness_behavior personalresp leu_gad
	est sto m2
	
	suest m1 m2
	test [m1_mean]leu_gad=[m2_mean]leu_gad
	// reject. 0.0231
	* bonferonni correction: test threshold is 0.05/3=0.0167

	tess, mediation	bonf (3)
	
*Test-Hyp45: Perceptions of PR will mediate the behavioral indicator of  perception of deservedness by patient's medical diagnosis (GAD vs. HIV).	
	
	reg deservedness_behavior gad_hiv
	est sto m1

	reg deservedness_behavior personalresp gad_hiv
	est sto m2
	
	suest m1 m2
	test [m1_mean]gad_hiv=[m2_mean]gad_hiv
	// reject. 0.2010

	tess, mediation	bonf (3)
